package com.vf.admin.client.dao;

import com.vf.admin.common.db.BaseDao;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.ExpressionsUserCustom;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Repository
public class ExpressionsUserCustomDao extends BaseDao<ExpressionsUserCustom> {

    public List<ExpressionsUserCustom> page(SplitPageBean splitPage, Map<String, Object> paraMap) {
        ArrayList<Object> paramList = new ArrayList<>();
        StringBuilder sbStr = new StringBuilder("select * from expressions_user_custom where 1=1");

        String sql = sbStr.toString();
        return this.queryList(sql, paramList, ExpressionsUserCustom.class, splitPage);
    }

    public List<ExpressionsUserCustom> list(Integer userId) {
        StringBuilder sbStr = new StringBuilder("select * from expressions_user_custom where userId="+userId);

        String sql = sbStr.toString();
        return this.queryList(sql, new ArrayList<>(), ExpressionsUserCustom.class);
    }

    public void del(Integer userId, Integer id) {
        StringBuilder sbStr = new StringBuilder("delete from expressions_user_custom where id="+ id + " and userId="+userId);

        String sql = sbStr.toString();
        this.del(sql, new ArrayList<>());
    }

}
